import { _delete, get, post, put } from '@/utils/request'

export class WebMenu {
  static addOrEdit(data) {
    if (!data.id)
      return post('/v1/webmenu/add', data)
    else
      return put(`/v1/webmenu/${data.id}`, data)
  }

  static getAllWebMenu() {
    return get('/v1/webmenu/')
  }

  static deleteWebMenu(id) {
    return _delete(`/v1/webmenu/${id}`)
  }

  static getContent(params) {
    return get('/v1/webmenu/getContent', params)
  }

  static getCarouselPicture(params) {
    return get('/v1/webmenu/getCarouselPicture', params)
  }

  static updateCarouselPicture(params) {
    return post('/v1/webmenu/updateCarouselPicture', params)
  }
}
